//可变参数
public class ChangeVariable {
    public static void main(String[] args) {
        System.out.println(getSum(1,2,3));
        System.out.println(getSum(1,2,3,4,5));
        System.out.println(getSum_(6,1,2,3,4,5,6));
    }

    public static int getSum(int... a){
        int sum = 0;
        for(int i : a)
            sum += i;
        return sum;
    }
    public static int getSum_(int a,int... b){
        int sum = 0;
        for(int i : b)
            sum += i;
        return sum;
    }
}
